package com.training.content.service.impl;

import java.util.List;
import com.training.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.training.content.mapper.AssessItemScoreMapper;
import com.training.content.domain.AssessItemScore;
import com.training.content.service.IAssessItemScoreService;

/**
 * 考核项得分Service业务层处理
 * 
 * @author training
 * @date 2021-10-25
 */
@Service
public class AssessItemScoreServiceImpl implements IAssessItemScoreService 
{
    @Autowired
    private AssessItemScoreMapper assessItemScoreMapper;

    /**
     * 查询考核项得分
     * 
     * @param scoreId 考核项得分主键
     * @return 考核项得分
     */
    @Override
    public AssessItemScore selectAssessItemScoreByScoreId(Long scoreId)
    {
        return assessItemScoreMapper.selectAssessItemScoreByScoreId(scoreId);
    }

    /**
     * 查询考核项得分列表
     * 
     * @param assessItemScore 考核项得分
     * @return 考核项得分
     */
    @Override
    public List<AssessItemScore> selectAssessItemScoreList(AssessItemScore assessItemScore)
    {
        return assessItemScoreMapper.selectAssessItemScoreList(assessItemScore);
    }

    /**
     * 新增考核项得分
     * 
     * @param assessItemScore 考核项得分
     * @return 结果
     */
    @Override
    public int insertAssessItemScore(AssessItemScore assessItemScore)
    {
        assessItemScore.setCreateTime(DateUtils.getNowDate());
        return assessItemScoreMapper.insertAssessItemScore(assessItemScore);
    }

    /**
     * 修改考核项得分
     * 
     * @param assessItemScore 考核项得分
     * @return 结果
     */
    @Override
    public int updateAssessItemScore(AssessItemScore assessItemScore)
    {
        assessItemScore.setUpdateTime(DateUtils.getNowDate());
        return assessItemScoreMapper.updateAssessItemScore(assessItemScore);
    }

    /**
     * 批量删除考核项得分
     * 
     * @param scoreIds 需要删除的考核项得分主键
     * @return 结果
     */
    @Override
    public int deleteAssessItemScoreByScoreIds(Long[] scoreIds)
    {
        return assessItemScoreMapper.deleteAssessItemScoreByScoreIds(scoreIds);
    }

    /**
     * 删除考核项得分信息
     * 
     * @param scoreId 考核项得分主键
     * @return 结果
     */
    @Override
    public int deleteAssessItemScoreByScoreId(Long scoreId)
    {
        return assessItemScoreMapper.deleteAssessItemScoreByScoreId(scoreId);
    }
}
